package com.wangxc.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.wangxc.service.HelloService;
import com.wangxc.core.IDemoService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @Date: 11:46  2017/12/4 0004.
 * @Author: WangXC
 */
@Controller
public class HelloController {
    @Reference(version = "1.0.0.1")
    private IDemoService demoService;
    @Resource
    private HelloService helloService;

    @RequestMapping("/hello")
    @ResponseBody
    public String sayHello(String hello) {
        return demoService.sayHello(hello);
    }

    @RequestMapping("/hello2")
    @ResponseBody
    public String sayHello2(String hello) {
        return helloService.sayHello(hello);
    }

    @RequestMapping
    @ResponseBody
    public String test(String a,int b){
        return helloService.test(a, b);
    }
}
